<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/manage/common/taglibs.jsp" %>
<script type="text/javascript">
    $(function () {
        $.acooly.framework.registerKeydown('manage_temperatureHumidity_from', 'manage_temperatureHumidity_datagrid');

        var curDate = new Date();
        var curYear =curDate.getFullYear();  //获取完整的年份(4位,1970-????)
        var curMonth = curDate.getMonth()+1;  //获取当前月份(0-11,0代表1月)
        var curDay = curDate.getDate();       //获取当前日(1-31)
        var Current= curYear+"-"+curMonth+"-"+curDay+' 00:00:00'
        var Current1= curYear+"-"+curMonth+"-"+curDay+' 23:59:59'
        $("#temperatureHumidty_begin").val(Current)
        $("#temperatureHumidty_end").val(Current1)
        setTimeout(function () {
            temperatureHumidityQuery()
        },500)


    });
    function temperatureHumidity_t(value,row) {
        if(value){
            return value;
        }else {
            return '√';
        }
        if(value=='true'){
            return '<i class="fa fa-check fa-lg fa-fw fa-col" style="color: green"></i>'
        }else{
            return '<i class="fa fa-times fa-lg fa-fw fa-col" style="color: red"></i>'
        }

    }
    function temperatureHumidityQuery() {
       var query= serializeObject($('#manage_temperatureHumidity_from'));
        $("#manage_temperatureHumidity_datagrid").datagrid({
            queryParams: query,
            url:'${pageContext.request.contextPath}/manage/demo/report/temperatureHumidityReport.html'
        });
        $('#manage_temperatureHumidity_datagrid').datagrid('uncheckAll').datagrid('unselectAll').datagrid('clearSelections');
    }
    function temperatureHumidity_t1(value,row) {
        var f_type=$("#manage_temperatureHumidity_from [name='type']").val();
        var str="'ffffff100000ef87','ffffff100000f2cf','ffffff100000f2d0','ffffff100000f308','ffffff100000f343','ffffff100000f368','ffffff100000f36c','ffffff100000f37b'";
        $.acooly.framework.show('/manage/demo/report/listAll.html?eId=9&eqid='+str+'&createTime='+value+'&type='+f_type,1300,500);
       // $.acooly.framework.show('/manage/demo/report/showdetal.html?eqid=0&createTime='+value,1300,500);
    }
    function temperatureHumidity_d(value,row) {
        return '   <a onclick=" temperatureHumidity_t1(\''+row.time+'\') " href="#" title="查看"><i class="fa fa-file-o fa-lg fa-fw fa-col"></i></a>';
    }
</script>
<div class="easyui-layout" data-options="fit : true,border : false">
    <!-- 查询条件 -->
    <div data-options="region:'north',border:false" style="padding:5px; overflow: hidden;" align="left">
        <form id="manage_temperatureHumidity_from"  onsubmit="return false">
            <table class="tableForm" width="100%">
                <tr>
                    <td align="left">
                        <div>
                            <span>类型：</span>
                            <select name="type" editable="false" style="height:27px;width: 150px" panelHeight="auto" class="easyui-combobox">
                                <option value="1">日报</option>
                                <option value="2">月报</option>
                                <option value="3">年报</option>
                            </select>
                            <span class="div_outter_text">
                            <input id="temperatureHumidty_begin" name="begin" type="text" onFocus="WdatePicker({readOnly:false,dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="line-height:28px;
                                   border-radius: 5px; border:1px #95B8E7 solid; width:146px; vertical-align: middle;" placeholder="开始时间" prompt="限办时间(开始)"/>
                        </span>
                            <span class="div_outter_text">
                            <input id="temperatureHumidty_end" name="end" type="text" onFocus="WdatePicker({readOnly:false,dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="line-height: 28px;
                                border-radius: 5px; border:1px #95B8E7 solid; width:146px; vertical-align: middle;" placeholder="结束时间" prompt="限办时间(结束)" />
                        </span>
                          <%--  <a href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:false"
                               onclick="$.acooly.framework.search('manage_temperatureHumidity_from','manage_temperatureHumidity_datagrid');">
                                <i class="fa fa-search fa-lg fa-fw fa-col"></i>查询</a>--%>
                            <a href="javascript:void(0);" class="easyui-linkbutton" id="seach_data" data-options="plain:false"
                               onclick="temperatureHumidityQuery()">
                                <i class="fa fa-search fa-lg fa-fw fa-col"></i>查询</a>
                            <a href="#" class="easyui-linkbutton" iconCls="icon-excel" plain="false"
                               onclick="$.lora.common.commonExportReport('manage_temperatureHumidity_datagrid','温湿度数据报表')">导出</a>
                        </div>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div data-options="region:'center',border:false">
        <table id="manage_temperatureHumidity_datagrid" class="easyui-datagrid" url="" toolbar="#manage_temperatureHumidity_toolbar" fit="true" border="false" fitColumns="false"
               checkOnSelect="true" selectOnCheck="true" singleSelect="true">
            <thead>
            <tr>
                <th align="center" colspan="18">温湿度</th>
            </tr>
            <tr>
                <th align="center" field="rowActions" data-options="formatter:function(value, row, index){return temperatureHumidity_d(value,row)}" width="80" rowspan="2">动作</th>
                <th align="center"  field="time"  width="100"  rowspan="2">记录时间</th>
                <th align="center"  colspan="2">操作间上方</th>
                <th align="center"  colspan="2">1号机柜上方</th>
                <th align="center"  colspan="2">9号机柜上方</th>
                <th align="center"  colspan="2">2号机柜</th>
                <th align="center"  colspan="2">4号机柜</th>
                <th align="center"  colspan="2">6号机柜</th>
                <th align="center"  colspan="2">8号机柜</th>
                <th align="center"  colspan="2">10号机柜</th>
            </tr>
            <tr>
                <th align="center" field="t1">温度</th>
                <th align="center" field="s1">湿度</th>
                <th align="center" field="t2">温度</th>
                <th align="center" field="s2">湿度</th>
                <th align="center" field="t3">温度</th>
                <th align="center" field="s3">湿度</th>
                <th align="center" field="t4">温度</th>
                <th align="center" field="s4">湿度</th>
                <th align="center" field="t5">温度</th>
                <th align="center" field="s5">湿度</th>
                <th align="center" field="t6">温度</th>
                <th align="center" field="s6">湿度</th>
                <th align="center" field="t7">温度</th>
                <th align="center" field="s7">湿度</th>
                <th align="center" field="t8">温度</th>
                <th align="center" field="s8">湿度</th>
            </tr>
            </thead>
        </table>
        <div id="manage_temperatureHumidity_toolbar">

        </div>
    </div>
</div>